﻿using Microsoft.Extensions.Caching.Memory;

namespace WebApplication1.CacheHelper
{
    public interface IMemoryChcheHelper
    {
        TResult? GetOrCreate<TResult>(string cacheKey, Func<ICacheEntry, TResult?> valueFactory, int expirationTime = 60);
        Task<TResult?> GetOrCreateAsync<TResult>(string cacheKey, Func<ICacheEntry, Task<TResult?>> valueFactory, int expirationTime = 60);
        void Remove(string cacheKey);
    }
}
